<?php

namespace app\common\model\log;

use think\model\concern\SoftDelete;
use tmcore\base\BaseModel;
use tmcore\traits\ModelTrait;

/**
 * 导出文件日志模型
 */
class ExportFileLog extends BaseModel
{
    use ModelTrait;
    use SoftDelete;

    /**
     * 类型描述
     * @param $value
     * @param $data
     * @return string
     */
    public function getTypeDescAttr($value, $data)
    {
        if($data['type'] == 1) {
            return '同步';
        } else {
            return '异步';
        }
    }

    /**
     * 状态描述
     * @param $value
     * @param $data
     * @return string
     */
    public function getResultDescAttr($value, $data)
    {
        if($data['result'] == 0) {
            return '导出中';
        } else if($data['result'] == 1) {
            return '导出成功';
        }else {
            return '导出失败';
        }
    }
}